﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="useroverview.aspx.cs" Inherits="Com.Rivyer.Web.admin.useroverview" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>用户一览</title>
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../css/rivcontent.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <%if (DesignMode)
      { %>
    <script type="text/javascript" src="../js/ASPxScriptIntelliSense.js"></script>
    <%} %>
    <script type="text/javascript">
        
    </script>
    <div>
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td height="30">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="24" bgcolor="#353c44">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td>
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td width="6%" height="19" valign="bottom">
                                                        <div align="center">
                                                            <img src="../images/tb.gif" width="14" height="14" /></div>
                                                    </td>
                                                    <td width="94%" valign="bottom">
                                                        <span class="STYLE1">用户一览</span>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center" style="font-size: 12px; width=100%">
                    <div id="rivcontent">
                        <div class="title">
                            所有使用用户一览</div>
                        <dx:ASPxGridView ID="user" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
                            KeyFieldName="username" Width="660px" Font-Size="12px" 
                            onrowdeleting="user_RowDeleting">
                            <Columns>
                                <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" Width="50px">
                                    <DeleteButton Visible="True" Text="删除">
                                    </DeleteButton>
                                    <ClearFilterButton Visible="True">
                                    </ClearFilterButton>
                                </dx:GridViewCommandColumn>
                                <dx:GridViewDataTextColumn Caption="用户名" FieldName="username" ReadOnly="True" 
                                    VisibleIndex="1">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="住址" FieldName="homeadress" VisibleIndex="4">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="qq" VisibleIndex="5">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="姓名" FieldName="realname" VisibleIndex="2">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="手机号" FieldName="telephone" VisibleIndex="6">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataSpinEditColumn Caption="年龄" FieldName="age" VisibleIndex="3">
                                    <PropertiesSpinEdit DisplayFormatString="g">
                                    </PropertiesSpinEdit>
                                </dx:GridViewDataSpinEditColumn>
                            </Columns>
                            <SettingsBehavior ConfirmDelete="True" />
                            <Settings ShowFilterRow="True" ShowFilterRowMenu="True" />
                            <Styles>
                                <Header HorizontalAlign="Center">
                                </Header>
                            </Styles>
                        </dx:ASPxGridView>
                        <span class="tips">删除用户操作请谨慎操作!</span>
                        <dx:ASPxButton ID="ASPxButton1" runat="server" Text="删除选中" 
                            onclick="ASPxButton1_Click">
                        </dx:ASPxButton>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ITConnectionString %>"
        DeleteCommand="DELETE FROM [tb_userinfo] WHERE [username] = @username" InsertCommand="INSERT INTO [tb_userinfo] ([username], [homeadress], [qq], [realname], [telephone], [age]) VALUES (@username, @homeadress, @qq, @realname, @telephone, @age)"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [tb_userinfo] WHERE [username] != 'rivyer'"
        UpdateCommand="UPDATE [tb_userinfo] SET [homeadress] = @homeadress, [qq] = @qq, [realname] = @realname, [telephone] = @telephone, [age] = @age WHERE [username] = @username">
        <DeleteParameters>
            <asp:Parameter Name="username" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="username" Type="String" />
            <asp:Parameter Name="homeadress" Type="String" />
            <asp:Parameter Name="qq" Type="String" />
            <asp:Parameter Name="realname" Type="String" />
            <asp:Parameter Name="telephone" Type="String" />
            <asp:Parameter Name="age" Type="Int32" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="homeadress" Type="String" />
            <asp:Parameter Name="qq" Type="String" />
            <asp:Parameter Name="realname" Type="String" />
            <asp:Parameter Name="telephone" Type="String" />
            <asp:Parameter Name="age" Type="Int32" />
            <asp:Parameter Name="username" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>
